<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="cn.kgc.entity.Comment" %>
<%@page import="cn.kgc.entity.User" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>爱购物-商城 - 首页</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="scripts/function.js"></script>
    <script type="text/javascript" src="scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
        function selectname() {
            var name = document.getElementById("selectname").value;
            location.href = 'selectProductList?name=' + name;
        }

        function searchHot(name) {
            location.href = 'selectProductList?name=' + name;
        }
    </script>
</head>
<body>
<div id="header" class="wrap">
    <div id="logo"><img src="images/logo.png"/></div>
    <div class="help"><c:if test="${name!=null}"><a href="selectdd?dd=${name.eu_user_id }">个人订单</a></c:if><c:if
            test="${name!=null}">当前用户${name.eu_user_id }</c:if><a href="ShopSelect" class="shopping">购物车</a><c:if
            test="${name==null}"><a href="login.jsp">登录</a>|<a href="register.jsp">注册</a></c:if><c:if
            test="${name!=null}"><a href="zx">退出</a></c:if><a href="SelallServlet">留言</a><c:if
            test="${name.eu_status==2}"><a href="WEB-INF/manage/index.jsp">去后台</a></c:if></div>
    <div class="navbar">
        <ul class="clearfix">
            <c:choose>
                <c:when test="${empty selected_fid}">
                    <li class="current"><a href="indexSelect">首页</a></li>
                </c:when>
                <c:otherwise>
                    <li><a href="indexSelect">首页</a></li>
                </c:otherwise>
            </c:choose>
            <c:forEach var="f" items="${flist}">
                <c:choose>
                    <c:when test="${selected_fid == f.epc_id}">
                        <li class="current"><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></li>
                    </c:when>
                    <c:otherwise>
                        <li><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></li>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </ul>
    </div>
</div>
<div id="childNav">
    <div class="wrap">
        <ul class="clearfix">
            <li class="first"><a href="javascript:searchHot('chocolate')">巧克力</a></li>
            <li><a href="javascript:searchHot('beef')">牛肉干</a></li>
            <li><a href="javascript:searchHot('biscuit')">饼干</a></li>
            <li><a href="javascript:searchHot('dry fruit')">水果干</a></li>
            <li><a href="javascript:searchHot('shampoo')">洗发水</a></li>
            <li><a href="javascript:searchHot('toothpaste')">牙膏</a></li>
            <li><a href="javascript:searchHot('body wash')">沐浴露</a></li>
            <li><a href="javascript:searchHot('dress')">连衣裙</a></li>
            <li><a href="javascript:searchHot('T-shirt')">T恤</a></li>
            <li><a href="javascript:searchHot('jeans')">牛仔裤</a></li>
            <%--<li><a href="javascript:searchHot('运动鞋')">运动鞋</a></li>
            <li><a href="javascript:searchHot('美容护肤')">美容护肤</a></li>
            <li><a href="javascript:searchHot('饰品')">饰品</a></li>--%>
            <li class="last"><input type="text" id="selectname" value="${search_words}"/><a
                    href="javascript:selectname()">搜索</a></li>
        </ul>
    </div>
</div>
<div id="position" class="wrap">
    您现在的位置：<a href="index.jsp">爱购物-商城</a> &gt; 在线留言
</div>
<div id="main" class="wrap">
    <div class="lefter">
        <div class="box">
            <div class="box">
                <h2>商品分类</h2>
                <dl>
                    <dt><a href="selectProductList">全部商品</a></dt>
                    <c:forEach var="f" items="${flist}">
                        <dt><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></dt>
                        <c:forEach var="c" items="${clist}">
                            <c:if test="${f.epc_id==c.epc_parent_id}">
                                <c:if test="${p.epc_child_id!=c.epc_id}">
                                    <dd><a href="selectProductList?cid=${c.epc_id }">${c.epc_name }</a></dd>
                                </c:if>
                            </c:if>
                        </c:forEach>
                    </c:forEach>
                </dl>
            </div>
        </div>
    </div>
    <div class="main">
        <div class="guestbook">
            <h2>全部留言</h2>
            <ul>
                <li>
                    <c:forEach var="comment" items="${list}">
                        <dl>
                            <dt>${comment.ec_content }</dt>
                            <dd class="author">网友：${comment.ec_nick_name }
                                <span class="timer"> ${comment.ec_create_time }</span></dd>
                            <dd><c:if test="${empty comment.ec_reply}">
                                未回复
                            </c:if>
                                <c:if test="${not empty comment.ec_reply}">
                                    回复：<c:out value="${comment.ec_reply }"/>
                                </c:if></dd>

                        </dl>
                    </c:forEach>

                </li>

            </ul>
            <div class="clear"></div>
            <div class="pager">
                <ul class="clearfix">
                    ${pageCode }
                </ul>
            </div>
            <div id="reply-box">
                <form action="GueServlet" method="post" onsubmit="return checkComments(this)">
                    <table>
                        <tr>
                            <td class="field">昵称：</td>
                            <td><input class="text" name="guestName"/><span style="color: red"></span></td>
                        </tr>
                        <tr>
                            <td class="field">留言内容：</td>
                            <td>
                                <textarea id="content_1" name="guestContent"></textarea><span style="color: red"></span>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><label class="ui-blue"><input type="submit" name="submit" value="提交留言"/></label></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<div id="footer">
    Copyright &copy; 2019 爱购物 All Rights Reserved. 苏ICP备案888888号
</div>
</body>
</html>
